###################################################
# File:
#   my tmux settings
# Usage:
#   mkdir -p ~/.tmux/plugins
#   git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
#   cp -a tmux.conf ~/.tmux.conf
# Author:
#   yongliang <neeyongliang@gmail.com>
# Changelog:
#   20221210 first release
###################################################

# Add plugins
set -g @plugin 'http://github.com/tmux-plugins/tpm.git'
set -g @plugin 'http://github.com/tmux-plugins/tmux-sensible.git'
# set -g @plugin 'http://gitee.com/wuxler/tmux-sensible.git'
set -g @plugin 'http://gitee.com/fount4j/tmux-yank.git'
# set -g @plugin 'http://github.com/tmux-plugins/tmux-cpu.git'

run '~/.tmux/plugins/tpm/tpm'

# Send prefix
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix

# Use Alt-arrow keys to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window

# Mouse mode
set -g mouse on

# Key bindings
unbind _
unbind |
bind | split-window -h -c "#{pane_current_path}"
bind _ split-window -v -c "#{pane_current_path}"
bind R source-file '~/.tmux.conf'

# Theme1
set -g status-left-length 300
set -g status-right-length 400
# set -g status-left  " session: #S "
set -g status-left  "☯ session: #S "
set -g status-right " C-a  %Y-%m-%d %H:%M  $USER@#h "
set -g status-justify centre
set -g status-position top

# Theme2
# set -g status-left  "#[fg=#1b1b1b, bg=#ffa31a]  session: #S "
# set -g status-right "  C-a  %Y-%m-%d %H:%M  $USER@#h "
# set -g status-justify centre
# set -g status-position top


# Other settings
set-window-option -g mode-keys vi
set -g escape-time 0
set -g history-limit 50000
set -g display-time 4000
set -g default-terminal "screen-256color"
